<jsp:include page="logincheck.jsp" />
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page import="java.util.*" %>

<jsp:useBean id="message" class="se2.Message" scope="request"/>
<jsp:setProperty name="message" property="*"/>

<html>

	<head>
		<title>Administration Console</title>
		<link rel="stylesheet" href="default.css" type="text/css" media="screen"></link>
		<script src="sorttable.js"></script>
	</head>

	<body>
		<div id="container">
			<div id="navigation">
<p>&nbsp;</p>
<jsp:include page="navigation.jsp" />
			</div>
			
			<div id="header">				
				<img src="images/header.png" />
			</div>

			<div id="content">
<!-- Main code -->

<h1>Administrator  :: Mailbox</h1>

<table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr style="background-image: url('images/tableBackground.png');">
		<th style="background-image: url('images/tableBackground.png');" width="10" class="sorttable_nosort tableHeader" align="center"></th>
		<th style="background-image: url('images/tableBackground.png');" width="160" class="tableHeader" align="center">Message Status</th>
		<th style="background-image: url('images/tableBackground.png');" width="*" class="tableHeader" align="left">Subject</th>
		<th style="background-image: url('images/tableBackground.png');" width="*" class="tableHeader" align="left">Date</th>
		<th style="background-image: url('images/tableBackground.png');" width="10" class="sorttable_nosort tableHeader">&nbsp;</th>
	</tr>
<% boolean odd = false; %>
<c:forEach var="msg" items="${message.allMessages}">
	<% if (odd) { %>
		<tr style="background-image: url('images/tableBackground.png');">
	<% } else { %>
		<tr>
	<% } odd = !odd; %>
		<td align="center">&nbsp;</td>
		<td align="center">${msg.status}</td>
		<td><a href="viewMessage.jsp?id=${msg.id}">${msg.subject}</a></td>
		<td>${msg.dateString}</td>
		<td align="center">&nbsp;</td>
	</tr>
</c:forEach>
</table>

<!-- Main Code -->
			</div>

			<div id="footer">
<jsp:include page="footer.jsp" />
			</div>
		</div>
	</body>

</html>